{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport ThemeContext from '../useTheme/ThemeContext';\nimport useTheme from '../useTheme';\nimport nested from './nested'; // To support composition of theme.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n  if (typeof localTheme === 'function') {\n    const mergedTheme = localTheme(outerTheme);\n    if (process.env.NODE_ENV !== 'production') {\n      if (!mergedTheme) {\n        console.error(['MUI: You should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />'].join('\\n'));\n      }\n    }\n    return mergedTheme;\n  }\n  return _extends({}, outerTheme, localTheme);\n}\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\n\nfunction ThemeProvider(props) {\n  const {\n    children,\n    theme: localTheme\n  } = props;\n  const outerTheme = useTheme();\n  if (process.env.NODE_ENV !== 'production') {\n    if (outerTheme === null && typeof localTheme === 'function') {\n      console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', '<ThemeProvider theme={outerTheme => outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n    }\n  }\n  const theme = React.useMemo(() => {\n    const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n    if (output != null) {\n      output[nested] = outerTheme !== null;\n    }\n    return output;\n  }, [localTheme, outerTheme]);\n  return /*#__PURE__*/_jsx(ThemeContext.Provider, {\n    value: theme,\n    children: children\n  });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n  /**\n   * Your component tree.\n   */\n  children: PropTypes.node,\n  /**\n   * A theme object. You can provide a function to extend the outer theme.\n   */\n  theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n  process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","map":{"version":3,"names":["_extends","React","PropTypes","exactProp","ThemeContext","useTheme","nested","jsx","_jsx","mergeOuterLocalTheme","outerTheme","localTheme","mergedTheme","process","env","NODE_ENV","console","error","join","ThemeProvider","props","children","theme","useMemo","output","Provider","value","propTypes","node","oneOfType","object","func","isRequired"],"sources":["/data/messenger.client/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport ThemeContext from '../useTheme/ThemeContext';\nimport useTheme from '../useTheme';\nimport nested from './nested'; // To support composition of theme.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n  if (typeof localTheme === 'function') {\n    const mergedTheme = localTheme(outerTheme);\n\n    if (process.env.NODE_ENV !== 'production') {\n      if (!mergedTheme) {\n        console.error(['MUI: You should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />'].join('\\n'));\n      }\n    }\n\n    return mergedTheme;\n  }\n\n  return _extends({}, outerTheme, localTheme);\n}\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\n\n\nfunction ThemeProvider(props) {\n  const {\n    children,\n    theme: localTheme\n  } = props;\n  const outerTheme = useTheme();\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (outerTheme === null && typeof localTheme === 'function') {\n      console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', '<ThemeProvider theme={outerTheme => outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n    }\n  }\n\n  const theme = React.useMemo(() => {\n    const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n\n    if (output != null) {\n      output[nested] = outerTheme !== null;\n    }\n\n    return output;\n  }, [localTheme, outerTheme]);\n  return /*#__PURE__*/_jsx(ThemeContext.Provider, {\n    value: theme,\n    children: children\n  });\n}\n\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n  /**\n   * Your component tree.\n   */\n  children: PropTypes.node,\n\n  /**\n   * A theme object. You can provide a function to extend the outer theme.\n   */\n  theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n  process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\n\nexport default ThemeProvider;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,YAAY;AACtC,OAAOC,YAAY,MAAM,0BAA0B;AACnD,OAAOC,QAAQ,MAAM,aAAa;AAClC,OAAOC,MAAM,MAAM,UAAU,CAAC,CAAC;;AAE/B,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAE/C,SAASC,oBAAoB,CAACC,UAAU,EAAEC,UAAU,EAAE;EACpD,IAAI,OAAOA,UAAU,KAAK,UAAU,EAAE;IACpC,MAAMC,WAAW,GAAGD,UAAU,CAACD,UAAU,CAAC;IAE1C,IAAIG,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MACzC,IAAI,CAACH,WAAW,EAAE;QAChBI,OAAO,CAACC,KAAK,CAAC,CAAC,iEAAiE,EAAE,sCAAsC,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;MACvI;IACF;IAEA,OAAON,WAAW;EACpB;EAEA,OAAOZ,QAAQ,CAAC,CAAC,CAAC,EAAEU,UAAU,EAAEC,UAAU,CAAC;AAC7C;AACA;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